{% extends "base.html" %}

{% block title %}
新闻管理
{% endblock %}

{% block content %}
    <!-- Page Content -->
    <div id="page-wrapper">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">
                        新闻管理<a class="btn btn-default pull-right" href="/add_news">添加</a>
                    </h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="row">
                        <table class="table">
                            <thead>
                            <tr>
                            <tr>
                                <th>标题</th>
                                <th>作者</th>
                                <th>时间</th>
                                <th>操作</th>
                            </tr>
                            </tr>
                            </thead>
                            <tbody>
                            {% for news in news_list%}
                            <tr>
                                <td class="col-lg-3">{{news.title}}</td>
                                <td class="col-lg-3">{{news.author}}</td>
                                <td class="col-lg-3">{{news.public_time}}</td>
                                <td class="col-lg-3">
                                    <a class="btn btn-default" href="/detail_news?id={{news.id}}">详情</a>
                                    <a class="btn btn-default" href="/edit_news?id={{news.id}}">编辑</a>
                                    <a class="btn btn-default"
                                       href="/news?id={{news.id}}">删除</a>
                                </td>
                            </tr>
                            {% endfor %}

                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- /.col-lg-12 -->
            </div>
        </div>
        <!-- /.container-fluid -->
    </div>
    <!-- /#page-wrapper -->
{% endblock %}